package com.xy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

//跳转页面
@Controller
public class RouterController {

    @RequestMapping({"/","/index"})
    public String index(){
        return "index";
    }

    @RequestMapping("/tologin")
    public String toLogin(){
        return "views/login";
    }

    @RequestMapping("/{name}/{id}")
    public String level(@PathVariable("name") String name,@PathVariable("id") Integer id){
        return "views/"+name+"/"+id;
    }
}
